/**
 * 遍历即可
 */
public class _3110字符串的分数 {
    public static int scoreOfString(String s) {
        int score=0;
        for (int i = 1; i < s.length(); i++) {
            score += Math.abs(s.charAt(i-1)-s.charAt(i));

        }

       return score; 
    }

    public static void main(String[] args) {
        System.out.println(scoreOfString("hello"));
        System.out.println(scoreOfString("zaz"));
    }
}
